package com.muyu.danmo.service.impl;


import com.muyu.common.core.utils.DateUtils;
import com.muyu.danmo.domain.DanmoTrainingShoppingProductsCarousel;
import com.muyu.danmo.mapper.DanmoTrainingShoppingProductsCarouselMapper;
import com.muyu.danmo.service.IDanmoTrainingShoppingProductsCarouselService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 培训班商品轮播图Service业务层处理
 * 
 * @author kunzong
 * @date 2024-11-28
 */
@Service
public class DanmoTrainingShoppingProductsCarouselServiceImpl implements IDanmoTrainingShoppingProductsCarouselService
{
    @Autowired
    private DanmoTrainingShoppingProductsCarouselMapper danmoTrainingShoppingProductsCarouselMapper;

    /**
     * 查询培训班商品轮播图
     * 
     * @param id 培训班商品轮播图主键
     * @return 培训班商品轮播图
     */
    @Override
    public DanmoTrainingShoppingProductsCarousel selectDanmoTrainingShoppingProductsCarouselById(Long id)
    {
        return danmoTrainingShoppingProductsCarouselMapper.selectDanmoTrainingShoppingProductsCarouselById(id);
    }

    /**
     * 查询培训班商品轮播图列表
     * 
     * @param danmoTrainingShoppingProductsCarousel 培训班商品轮播图
     * @return 培训班商品轮播图
     */
    @Override
    public List<DanmoTrainingShoppingProductsCarousel> selectDanmoTrainingShoppingProductsCarouselList(DanmoTrainingShoppingProductsCarousel danmoTrainingShoppingProductsCarousel)
    {
        return danmoTrainingShoppingProductsCarouselMapper.selectDanmoTrainingShoppingProductsCarouselList(danmoTrainingShoppingProductsCarousel);
    }

    /**
     * 新增培训班商品轮播图
     * 
     * @param danmoTrainingShoppingProductsCarousel 培训班商品轮播图
     * @return 结果
     */
    @Override
    public int insertDanmoTrainingShoppingProductsCarousel(DanmoTrainingShoppingProductsCarousel danmoTrainingShoppingProductsCarousel)
    {
        danmoTrainingShoppingProductsCarousel.setCreateTime(DateUtils.getNowDate());
        return danmoTrainingShoppingProductsCarouselMapper.insertDanmoTrainingShoppingProductsCarousel(danmoTrainingShoppingProductsCarousel);
    }

    /**
     * 修改培训班商品轮播图
     * 
     * @param danmoTrainingShoppingProductsCarousel 培训班商品轮播图
     * @return 结果
     */
    @Override
    public int updateDanmoTrainingShoppingProductsCarousel(DanmoTrainingShoppingProductsCarousel danmoTrainingShoppingProductsCarousel)
    {
        danmoTrainingShoppingProductsCarousel.setUpdateTime(DateUtils.getNowDate());
        return danmoTrainingShoppingProductsCarouselMapper.updateDanmoTrainingShoppingProductsCarousel(danmoTrainingShoppingProductsCarousel);
    }

    /**
     * 批量删除培训班商品轮播图
     * 
     * @param ids 需要删除的培训班商品轮播图主键
     * @return 结果
     */
    @Override
    public int deleteDanmoTrainingShoppingProductsCarouselByIds(Long[] ids)
    {
        return danmoTrainingShoppingProductsCarouselMapper.deleteDanmoTrainingShoppingProductsCarouselByIds(ids);
    }

    /**
     * 删除培训班商品轮播图信息
     * 
     * @param id 培训班商品轮播图主键
     * @return 结果
     */
    @Override
    public int deleteDanmoTrainingShoppingProductsCarouselById(Long id)
    {
        return danmoTrainingShoppingProductsCarouselMapper.deleteDanmoTrainingShoppingProductsCarouselById(id);
    }
}
